.PHONY: default test test-standalone

EXEC_SUFFIX=.exe

EXEC = latup$(EXEC_SUFFIX)

default: $(EXEC)

SCM_FILES = $(wildcard *.scm)

.afile: $(SCM_FILES)
	bglafile -I. $^ -o $@

%.o: %.scm .afile
	bigloo -c $< -o $@

$(EXEC): latup.o latup-standalone.o .afile
	bigloo latup.o latup-standalone.o -o $@

test$(EXEC_SUFFIX): latup.o test.o .afile
	bigloo latup.o test.o -o $@

test: test.exe test-standalone 
	./$<

test-standalone: $(EXEC) standalone-test-input.c
	cat standalone-test-input.c | ./$(EXEC) > standalone-test-output.c.temp
	diff standalone-test-output.c.temp standalone-test-expected-output.c
